Skip to content

Upgrade gopkg.in/yaml.v2 to go.yaml.in/yaml/v3#2023

Merged
openshift-merge-bot[bot] merged 5 commits into
operator-framework:masterfrom
chimanjain:deps/upgrade-yaml-v3
Jul 10, 2026
Merged

Upgrade gopkg.in/yaml.v2 to go.yaml.in/yaml/v3#2023
openshift-merge-bot[bot] merged 5 commits into
operator-framework:masterfrom
chimanjain:deps/upgrade-yaml-v3

Conversation

@chimanjain

@chimanjain chimanjain commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Description of the change:

Upgraded gopkg.in/yaml.v2 to go.yaml.in/yaml/v3(YAML maintained repository).

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

Copilot AI review requested due to automatic review settings June 24, 2026 04:36
@openshift-ci
openshift-ci Bot requested review from camilamacedo86 and pedjak June 24, 2026 04:36
@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Hi @chimanjain. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the Operator Registry codebase to use gopkg.in/yaml.v3 instead of gopkg.in/yaml.v2, aligning YAML encoding/decoding usage with the newer major version across relevant packages.

Changes:

  • Switched Go imports from gopkg.in/yaml.v2 to gopkg.in/yaml.v3 in bundle, indexer, and sqlite test code.
  • Updated go.mod to require gopkg.in/yaml.v3 v3.0.1 directly (with gopkg.in/yaml.v2 remaining as an indirect dependency).
  • Minor test formatting adjustments for readability in pkg/sqlite/directory_test.go.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/sqlite/directory_test.go Updates YAML import to v3 and reformats a couple of composite literals in assertions.
pkg/lib/indexer/indexer.go Updates YAML import to v3 for indexer YAML interactions.
pkg/lib/bundle/utils_test.go Updates YAML import to v3 for test YAML marshaling.
pkg/lib/bundle/generate.go Updates YAML import to v3 for bundle annotation/dockerfile generation workflows.
pkg/lib/bundle/generate_test.go Updates YAML import to v3 for YAML-based tests.
pkg/lib/bundle/chartutil.go Updates YAML import to v3 for Helm chart metadata parsing.
go.mod Moves the direct dependency from gopkg.in/yaml.v2 to gopkg.in/yaml.v3.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@perdasilva

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2026
@perdasilva perdasilva removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 24, 2026
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2026
@chimanjain

Copy link
Copy Markdown
Contributor Author

thanks @perdasilva and @rashmigottipati for reviewing the PR, I fixed the UT'S and set the indentation to 2 to match the behavior of yaml.v3 with yaml.v2. The UT's are passing in my local environment, please re-review.

@camilamacedo86

Copy link
Copy Markdown
Contributor

I would not move with it.
Both are deprecated and should no longer be used.
Same of for example: kubernetes-sigs/controller-tools#1440

@perdasilva @rashmigottipati

Copilot AI review requested due to automatic review settings June 24, 2026 18:24
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2026
@chimanjain
chimanjain force-pushed the deps/upgrade-yaml-v3 branch from e679a16 to 52ecb0c Compare June 24, 2026 18:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread go.mod
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2026
Copilot AI review requested due to automatic review settings June 24, 2026 18:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread go.mod Outdated
@chimanjain chimanjain changed the title Upgrade gopkg.in/yaml from v2 to v3 Upgrade gopkg.in/yaml.v2 to go.yaml.in/yaml/v3 Jun 24, 2026
@chimanjain

Copy link
Copy Markdown
Contributor Author

Thanks @camilamacedo86 for the review. I've update the gomodule to go.yaml.in/yaml/v3 (YAML maintained repository). Please re-review.

Comment thread pkg/lib/bundle/validate_test.go Outdated
directory: "./testdata/validate/invalid_manifests_bundle/invalid_sa/",
numErrors: 1,
errStrings: []string{"json: cannot unmarshal number into Go struct field ObjectMeta.metadata.namespace of type string"},
errStrings: []string{"json: cannot unmarshal number into Go struct field Meta.metadata.namespace of type string"},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think you need to revert this line to pass the unit CI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @grokspawn made this change, fingers crossed.

Copilot AI review requested due to automatic review settings July 9, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Signed-off-by: Chiman Jain <chimanjain15@gmail.com>
…tencies

Signed-off-by: Chiman Jain <chimanjain15@gmail.com>
Signed-off-by: Chiman Jain <chimanjain15@gmail.com>
Signed-off-by: Chiman Jain <chimanjain15@gmail.com>
Signed-off-by: Chiman Jain <chimanjain15@gmail.com>
Copilot AI review requested due to automatic review settings July 9, 2026 15:35
@chimanjain
chimanjain force-pushed the deps/upgrade-yaml-v3 branch from 34c88e0 to 8734347 Compare July 9, 2026 15:35
@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2026
@camilamacedo86 camilamacedo86 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@grokspawn

Copy link
Copy Markdown
Contributor

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jul 10, 2026
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.81%. Comparing base (f470500) to head (8734347).

Files with missing lines Patch % Lines
pkg/lib/bundle/generate.go 57.14% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2023      +/-   ##
==========================================
- Coverage   58.81%   58.81%   -0.01%     
==========================================
  Files         141      141              
  Lines       13430    13434       +4     
==========================================
+ Hits         7899     7901       +2     
- Misses       4322     4323       +1     
- Partials     1209     1210       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@grokspawn

Copy link
Copy Markdown
Contributor

/override codecov/patch

@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@grokspawn: Overrode contexts on behalf of grokspawn: codecov/patch

Details

In response to this:

/override codecov/patch

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@grokspawn

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 10, 2026
@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn, rashmigottipati

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit 8df27aa into operator-framework:master Jul 10, 2026
13 of 14 checks passed
@chimanjain
chimanjain deleted the deps/upgrade-yaml-v3 branch July 10, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants